<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<TITLE></TITLE>
		<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<link rel="stylesheet" type="text/css" href="../Meta.css">
	</HEAD>
	<BODY>
		<H1>InvalidCastException</H1>
		<H2>What it means</H2>
		<P>This means a primitive procedure you called attempted to perform an operation 
			with the wrote type of data.</P>
		<H2>What causes it</H2>
		<UL>
			<LI>
				Passing a parameter of an invalid type to a primitive procedure.&nbsp;&nbsp;In 
				a sense, this is a variant of the <A href="ArgumentTypeException.htm">ArgumentTypeException</A>.</LI>
			<LI>
				Otherwise passing a value to a primitive procedure that "breaks" 
				it.&nbsp;&nbsp;For example: <FONT face="Arial">[+ 1 false]</FONT></LI>
			<LI>
				A bug in the implementation of the primitive procedure.</LI>
			<LI>
				Using a condition expression in an <FONT face="Arial">if</FONT> or <FONT face="Arial">
					while</FONT>&nbsp;expression that doesn't return a Boolean (<FONT face="Arial">true</FONT>
				or <FONT face="Arial">false</FONT>).</LI>
			<LI>
				Occasionally, it can happen because you pass the wrong kind of number to 
				something expecting a number.&nbsp; For example, if you use 1.0 as&nbsp;in 
				index into a list (indicies have to be integers, not floating-point numbers).</LI></UL>
		<H2>What to do</H2>
		<UL>
			<LI>
				If the error was generated while executing a primitive procedure, check that 
				its arguments are appropriate.</LI>
			<LI>
				If the error was not generated by a procedure, it was likely generated in an <FONT face="Arial">
					if</FONT> or <FONT face="Arial">while</FONT> expression.&nbsp; Check that 
				the expression is returning a Boolean.</LI></UL>
	</BODY>
</HTML>
